package com.zzb.valid.config;

import com.zzb.valid.util.I18nUtil;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.ResourceBundleMessageSource;

import java.util.Locale;

/**
 * @author create by zhouzongbo on 2020/10/27.
 */
@Configuration
public class I18nUtilInit {

    public I18nUtilInit(ResourceBundleMessageSource messageSource) {
        LocaleContextHolder.setDefaultLocale(Locale.SIMPLIFIED_CHINESE);
        I18nUtil.setMessageSource(messageSource);
    }
}
